package com.neuedu.elmserver.vo;

/**
 * @author: wudagai
 * 统一响应结果集对象
 */
public class ResultVO{
    private String message;//本次业务处理的结果提示
    private boolean flag;//本次业务处理的结果
    private Object object;//本次业务的结果集数据



    //成功-返回结果集
    public static ResultVO ok(String message,Object o){
        ResultVO model=new ResultVO();
        model.setFlag(true);
        model.setMessage(message);
        model.setObject(o);
        return model;
    }
    //成功-不返回结果集
    public static ResultVO ok(String message){
        ResultVO model=new ResultVO();
        model.setFlag(true);
        model.setMessage(message);
        return model;
    }
    //失败
    public static ResultVO fail(String message){
        ResultVO model=new ResultVO();
        model.setFlag(false);
        model.setMessage(message);
        return model;
    }
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }



}
